home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / a-taside.adb < prev    next >
Text File  |  1996-01-30  |  3KB  |  89 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --              A D A . T A S K _ I D E N T I F I C A T I O N               --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.6 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. with System.Tasking.Abortion;
  27. with System.Tasking.Stages;
  28. with System.Tasking.Rendezvous;
  29.  
  30. package body Ada.Task_Identification is
  31.  
  32.    ---------
  33.    -- "=" --
  34.    ---------
  35.  
  36.    function  "=" (Left, Right : Task_Id) return Boolean is
  37.    begin
  38.       return System.Tasking."=" (Convert_Ids (Left), Convert_Ids (Right));
  39.    end "=";
  40.  
  41.    -----------------
  42.    -- Abort_Task --
  43.    ----------------
  44.  
  45.    procedure Abort_Task (T : in out Task_Id) is
  46.    begin
  47.       System.Tasking.Abortion.Abort_Tasks
  48.         (System.Tasking.Task_List'(1 => Convert_Ids (T)));
  49.    end Abort_Task;
  50.  
  51.    ------------------
  52.    -- Current_Task --
  53.    ------------------
  54.  
  55.    function Current_Task return Task_Id is
  56.    begin
  57.       return Convert_Ids (System.Tasking.Self);
  58.    end Current_Task;
  59.  
  60.    -----------
  61.    -- Image --
  62.    -----------
  63.  
  64.    function Image (T : Task_Id) return String is
  65.    begin
  66.       return "???";  --  ???
  67.    end Image;
  68.  
  69.    -----------------
  70.    -- Is_Callable --
  71.    -----------------
  72.  
  73.    function Is_Callable (T : Task_Id) return Boolean is
  74.    begin
  75.       return System.Tasking.Rendezvous.Callable (Convert_Ids (T));
  76.    end Is_Callable;
  77.  
  78.    -------------------
  79.    -- Is_Terminated --
  80.    -------------------
  81.  
  82.    function Is_Terminated (T : Task_Id) return Boolean is
  83.    begin
  84.       return
  85.         System.Tasking.Stages.Terminated (Convert_Ids (T));
  86.    end Is_Terminated;
  87.  
  88. end Ada.Task_Identification;
  89.